import { http } from '@/services/request';
import { prefix } from './config';

// 添加
export const publicApiAdd = <P, R>(tableName: string, param: P): Promise<R> => http.post(`${prefix}/addValue/${tableName}`, param);

// 编辑
export const publicApiUpdate = <P, R>(tableName: string, param: P): Promise<R> => http.post(`${prefix}/updateValue/${tableName}`, param);

// 删除
export const publicApiDelete = <P>(tableName: string, param: P) => http.post(`${prefix}/deleteValueById/${tableName}`, param);

// 查询
export const publicApiQuery = <P, R>(tableName: string, param?: P): Promise<R> => http.post(`${prefix}/queryValue/${tableName}`, param);
